package wc.controller.factory;

import wc.model.component.Component;
import wc.model.component.roomcomponent.CashRegister;
import wc.model.component.roomcomponent.ShoeStoreCashRegister;
import wc.model.component.roomcomponent.ShoeStoreDoor;
import wc.model.component.roomcomponent.ShoeStoreShelf;
import wc.model.component.roomcomponent.StoreDoor;
import wc.model.component.roomcomponent.StoreShelf;
import wc.model.grid.TileGrid;

public class ShoeStoreComponentFactory extends StoreComponentFactory {
	private static ShoeStoreComponentFactory instance = null;

	private ShoeStoreComponentFactory() {}
	
	public static ShoeStoreComponentFactory getInstance() {
		if(instance == null) {
			instance = new ShoeStoreComponentFactory();
		}
		return instance;
	}

	public Object clone() throws CloneNotSupportedException {
		throw new CloneNotSupportedException(); 
	}

	public CashRegister createCashRegister() {
		TileGrid<Component> tg = new TileGrid<Component>(1,1);
		CashRegister c = new ShoeStoreCashRegister(tg);
		tg.setComponent(0, 0, c);
		return c;
	}
	
	public StoreDoor createStoreDoor() {
		TileGrid<Component> tg = new TileGrid<Component>(2,1);
		StoreDoor c = new ShoeStoreDoor(tg);
		tg.setComponent(0, 0, c);
		tg.setComponent(1, 0, c);
		return c;
	}
	
	public StoreShelf createStoreShelf() {
		TileGrid<Component> tg = new TileGrid<Component>(1,1);
		StoreShelf c = new ShoeStoreShelf(tg);
		tg.setComponent(0, 0, c);		
		return c;
	}
}
